<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
  export default {
    name: 'App',
    mounted() {
      window.addEventListener('unload', this.saveState);
    },
    methods: {
      saveState() {
        console.log(this.$store.state);
        sessionStorage.setItem('state', JSON.stringify(this.$store.state));
        // window
        sessionStorage.setItem('token', this.$store.getters.getToken);
      }
    }
  }
</script>

<style>
  #app {
    text-align: center;
    height: 100%;
  }

  body, html {
    margin: 0px;
    padding: 0px;
    height: 100%;
  }
</style>
